package csloader.loaders
{
	import flash.display.Bitmap;
	import flash.display.LoaderInfo;
	import flash.events.Event;

	public class ImageLoader extends DisplayObjectLoaderBase
	{
		public function ImageLoader(callback:Function)
		{
			super(callback);
		}
		
		/**
		 * 复制Bitmap对象并释放loader
		 * @param e
		 * @param url
		 * 
		 */
		override protected function contentCompleteHandler(e:Event, url:String) : void
		{
			var loaderinfo:LoaderInfo = LoaderInfo(e.target);			
			var response:Bitmap = new Bitmap(Bitmap(loaderinfo.content).bitmapData.clone());
			sendContentResponse(url, response);
			contentDispose();
		}
	}
}